package com.group.three.service.Impl;

import com.github.pagehelper.PageHelper;
import com.group.three.entity.MemberAddDTO;
import com.group.three.entity.MemberVO;
import com.group.three.mapper.MemberMapper;
import com.group.three.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberServiceImpl implements MemberService {

    @Autowired
    private MemberMapper memberMapper;

    @Override
    public List<MemberVO> getAll(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return memberMapper.getAll(pageNum, pageSize);
    }

    @Override
    public MemberVO getMember(String id) {
        return memberMapper.getMember(id);
    }

    @Override
    public int addMember(MemberAddDTO member) {
        return memberMapper.addMember(member);
    }

    @Override
    public int updateMemberStatus(String memberId, String disabled) {
        return memberMapper.updateMemberStatus(memberId, disabled);
    }
}
